package day12.abstractfactory;

import day12.abstractfactory.product1.ShapeFactory;
import day12.abstractfactory.product2.AnimalFactory;

public class FactoryProducer {

    public static final String FACTORY_ANIMAL = "Animal";
    public static final String FACTORY_SHAPE = "Shape";

    public static AbstractFactory getFactory(String factoryName) {
        if(FACTORY_ANIMAL.equals(factoryName)) return new AnimalFactory();
        if(FACTORY_SHAPE.equals(factoryName)) return new ShapeFactory();
        return null;
    }
}
